/*************************************************************************
*																		 *
*				code by Miles Chen (v-mich) 2007.9.27					 *
*																		 *
*																		 *
*************************************************************************/

#pragma once

namespace System{namespace Windows{namespace Forms{

	class CGameAppBase
	{
	public:
		CGameAppBase(void);
		~CGameAppBase(void);
		ATOM RegistryClass(void);
		HWND CreateGameWindow(HWND hwndParent = NULL);
		BOOL SetWindowTopMost(HWND hDlg, BOOL fTopmost = TRUE);
		BOOL CenterWindow(HWND hWnd);
		int ShowDialog(HWND hWnd);

	protected:
		HINSTANCE m_hInst;
		HICON m_hIcon;
		HCURSOR m_hCursor;

	protected:
		virtual void OnGameInit(HWND hWnd);
		virtual void OnGameCircle(HWND hWnd, DWORD dwTimerID);
		virtual void OnGameQuit(HWND hWnd);
		virtual void OnGameKeyDown(HWND hWnd, WORD wKey);
		virtual void OnGameKeyUp(HWND hWnd, WORD wKey);
		virtual void OnGameLeftMouseButtonDown(HWND hWnd, LPARAM lParam);
		virtual void OnGameLeftMouseButtonUp(HWND hWnd, LPARAM lParam);
		virtual void OnGameMouseMove(HWND hWnd, LPARAM lParam);

	private:
		static LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);

	};

}}}